package rocket.client;

import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JTextField;
import javax.swing.JLabel;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.factories.FormFactory;
import com.jgoodies.forms.layout.RowSpec;
import javax.swing.JPasswordField;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

/**
 * @author justin
 * @version
 *instantiates a window for the sole purpose of logging into the server using various
 *identification information
 */
public class Login extends JFrame {
	private static final long serialVersionUID = 6223607805284497306L;

	private JTextField txtUser;
	
	private JPasswordField passwordField;

	public static final Dimension minSize = new Dimension(180, 120);

	/**
	 * the said window
	 */
	public Login() {
		getContentPane().setLayout(
				new FormLayout(new ColumnSpec[] {
						ColumnSpec.decode("max(50px;default)"),
						ColumnSpec.decode("max(100dlu;default)"),
						FormFactory.LABEL_COMPONENT_GAP_COLSPEC,
						ColumnSpec.decode("114px:grow"), }, new RowSpec[] {
						FormFactory.LINE_GAP_ROWSPEC, RowSpec.decode("19px"),
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.DEFAULT_ROWSPEC, }));

		final JLabel lblUser = new JLabel(" User  ");
		getContentPane().add(lblUser, "1, 2, right, default");

		txtUser = new JTextField();
		getContentPane().add(txtUser, "2, 2, left, default");
		txtUser.setColumns(10);

		final JLabel lblPass = new JLabel("Pass  ");
		getContentPane().add(lblPass, "1, 4, right, default");

		passwordField = new JPasswordField();
		passwordField.setColumns(10);
		getContentPane().add(passwordField, "2, 4, left, default");

		JButton btnNewButton = new JButton("Login");
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
			}
		});
		getContentPane().add(btnNewButton, "2, 6, left, default");
	}

}
